﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Core.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "修改此模板以快速启动你的 ASP.NET MVC 应用程序。";
            
            return View();
        }

        public ActionResult Page(string channel)
        {
            channel = channel.ToLower();
            string path = String.Empty;
            if (channelPages.ContainsKey(channel))
            {
                path = channelPages[channel];
            }
            return View(path);
        }

        public ActionResult About()
        {
            ViewBag.Message = "你的应用程序说明页。";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "你的联系方式页。";

            return View();
        }

        private Dictionary<string, string> channelPages = new Dictionary<string, string>
        {
             {"about","~/Templates/skin1/about.cshtml"},
             {"contract","~/Templates/skin1/contract.cshtml"},
             {"case","~/Templates/skin1/case.cshtml"},
             {"index","~/Templates/skin1/index.cshtml"},
        };
    }
}
